import Vue from 'vue'
import App from './App.vue'
import Vuex from 'vuex'
Vue.use(Vuex)
const store = new Vuex.Store({
  strict: true,
  //  模块化
  modules: {
    user: {
      // 命名空间锁设定
      namespaced: true,
      state: {
        token: '666asd'
      },
      mutations:{
        testUserMutations(state){
          state.token = '测试模块 mutations'
        },
        testMutations(){
          console.log('user模块');
        }
      }
    },
    setting: {
      namespaced: true,
      state: {
        appName: 'vuex模拟测试'
      },
      mutations:{
        testMutations(){
          console.log('setting模块');
        }
      },
      actions: {
        testSettingAction(){
          console.log('测试 setting action');
        }
      }
    }
  }
})
Vue.config.productionTip = false

new Vue({
  store,
  render: h => h(App),
}).$mount('#app')
